Skip to content

config: hide sensitive input during baudbot config#32

Merged
benvinegar merged 1 commit into
mainfrom
benvinegar/hidden-secret-input
Feb 17, 2026
Merged

config: hide sensitive input during baudbot config#32
benvinegar merged 1 commit into
mainfrom
benvinegar/hidden-secret-input

Conversation

@benvinegar
Copy link
Copy Markdown
Member

Problem

Running baudbot config (or install.sh) echoes API keys and tokens in plaintext on the terminal. Anyone looking at the screen can see them.

Fix

prompt_secret now accepts a sensitive parameter (6th arg, defaults to true). When true and stdin is a terminal, uses read -rs to suppress echo.

Hidden (sensitive=true, default): API keys, tokens, secrets

  • ANTHROPIC_API_KEY, OPENAI_API_KEY, GEMINI_API_KEY, OPENCODE_ZEN_API_KEY
  • GITHUB_TOKEN, SLACK_BOT_TOKEN, SLACK_APP_TOKEN
  • AGENTMAIL_API_KEY, BAUDBOT_SECRET, SENTRY_AUTH_TOKEN, KERNEL_API_KEY

Visible (sensitive=false): non-secret identifiers

  • SLACK_ALLOWED_USERS, BAUDBOT_EMAIL, BAUDBOT_ALLOWED_EMAILS
  • SENTRY_ORG, SENTRY_CHANNEL_ID

Matches the @sensitive annotations in .env.schema.

CI compatibility

[ -t 0 ] check falls back to plain read -r when stdin is piped (CI), so automated tests are unaffected.

prompt_secret now uses read -rs (silent mode) for API keys, tokens,
and secrets so they aren't echoed to the terminal. Non-sensitive fields
like email addresses, user IDs, and org slugs remain visible.

Falls back to plain read when stdin is not a terminal (piped input
in CI), so automated tests are unaffected.
@greptile-apps
Copy link
Copy Markdown

greptile-apps Bot commented Feb 17, 2026

Greptile Summary

Adds password-style hidden input (read -rs) for sensitive credentials during baudbot config, protecting API keys and tokens from shoulder-surfing. Non-sensitive identifiers (SLACK_ALLOWED_USERS, email addresses, org slugs) remain visible. Terminal detection ([ -t 0 ]) preserves CI compatibility by falling back to plain input when stdin is piped.

Key changes:

  • Added 6th parameter sensitive (defaults to true) to prompt_secret function
  • Hidden input: API keys, tokens, secrets (aligned with .env.schema @sensitive annotations)
  • Visible input: user IDs, email addresses, channel IDs, org slugs
  • read -rs suppresses echo when stdin is a TTY; falls back to read -r in non-interactive contexts
  • package-lock.json changes are unrelated automated dependency metadata updates

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • Well-implemented security improvement with proper terminal detection, correct fallback behavior for CI/automation, and accurate alignment with existing .env.schema annotations. The logic is simple, defensive (defaults to secure behavior), and backwards-compatible.
  • No files require special attention

Important Files Changed

Filename Overview
bin/config.sh Adds input masking for sensitive credentials with proper terminal detection and CI fallback
slack-bridge/package-lock.json Marks @types/* packages as peer dependencies (automated npm update)

Last reviewed commit: 5953504

@benvinegar benvinegar merged commit 8e09046 into main Feb 17, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant